﻿using MengLin.OOP.DesignPattern.State.OrderManager.Entity;
using MengLin.OOP.DesignPattern.State.OrderManager.Implements;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.State.OrderManager
{
    class Program
    {
        static void Main(string[] args)
        {
            Order order = new Order();
            //待付款
            Console.WriteLine("==================================");
            order.SetState(new WaitPaymentState());
            Console.WriteLine(order.GetState());

            //付款
            Console.WriteLine("==================================");
            order.Payment();
            Console.WriteLine(order.GetState());

            //发货
            Console.WriteLine("==================================");
            order.SendGoods();
            Console.WriteLine(order.GetState());

            //收货
            Console.WriteLine("==================================");
            order.ReceiveGoods();
            Console.WriteLine(order.GetState());

            Console.Read();
        }
    }
}
